#include "pinctrl.h"
#include "watchdog.h"
#include "soc_osal.h"
#include "app_init.h"
#include "gpio.h"
#include "ili9341_lcd.h"
#include "gui.h"
#include "test.h"
#include "main.h"

#define TASK_STACK_SIZE 0x5000
#define TASK_PRIO 24

static int spi_ili9341_task(const char *arg)
{
    unused(arg);
    add_main();
    return 0;
}

static void ili9341_task_entry(void)
{
    osal_task *task_handle = NULL;
    osal_kthread_lock();
    task_handle = osal_kthread_create((osal_kthread_handler)spi_ili9341_task, 0, "ST7789Task", TASK_STACK_SIZE);
    if (task_handle != NULL) {
        osal_kthread_set_priority(task_handle, TASK_PRIO);
        osal_kfree(task_handle);
    }
    osal_kthread_unlock();
}

/* Run the entry. */
app_run(ili9341_task_entry);